package com.sofar.jwt.config;

import com.sofar.jwt.Interceptor.UserLoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author shiguorang
 * @version 1.0.0
 * @ClassName WebMvcConfig
 * @Description TODO
 * @createTime 2022年08月12日 16:06:00
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    /**
     * 自定义拦截器
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new UserLoginInterceptor())
                .addPathPatterns("/**")
                //开放登录路径
                .excludePathPatterns("/tblUser/login");
    }
}
